package com.invite.me.beans.adpater;

import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import com.invite.me.R;
import com.invite.me.beans.bilnddatabean.MySeetBqBean;

import java.util.List;


public class MySeetAdpater extends BaseQuickAdapter<MySeetBqBean,BaseViewHolder> {
    public MySeetAdpater(int layoutResId, @Nullable List<MySeetBqBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MySeetBqBean item) {
        helper.setText(R.id.name,item.getName())
        .addOnClickListener(R.id.name)
        .addOnClickListener(R.id.chacha);
        RelativeLayout buju=helper.getView(R.id.buju);
        TextView name=helper.getView(R.id.name);
        ImageView chacha = helper.getView(R.id.chacha);

        if(item.isDiaoqitankuang()){
            chacha.setVisibility(View.GONE);
            name.setTextColor(Color.rgb(153,153,153));
            Resources resources = mContext.getResources();
            Drawable drawable = resources.getDrawable(R.drawable.yuandibai);
            buju.setBackground(drawable);
        }else{
            if(item.isDianji()){
                chacha.setVisibility(View.VISIBLE);
                name.setTextColor(Color.rgb(255,255,255));
                Resources resources = mContext.getResources();
                Drawable drawable = resources.getDrawable(R.drawable.hongdper_yuan);
                buju.setBackground(drawable);

            }else {
                chacha.setVisibility(View.GONE);
                name.setTextColor(Color.rgb(124,65,57));


            }
        }





    }
}
